package com.mydesignpattern.beijing.responsibilitychain.middle.impl;

import com.mydesignpattern.beijing.responsibilitychain.middle.*;

/**
 * 表情替换实现类
 * Created by nevermore on 17/4/25.
 */
public class FaceFilter implements Filter {
    @Override
    public void doFilter(Request request, Response response, FilterChain filterChain) {
        //表情替换为符号或者表情图片地址
        System.out.println("facefilter 处理request");
        request.setRequestStr(request.getRequestStr().replace("/haha","^ v ^") );;
        filterChain.doFilter(request,response,filterChain );
        System.out.println("facefilter 处理response");
        response.setResponseStr(response.getResponseStr().replace("/haha","^ v ^"));;
    }
}
